-
Notifications
You must be signed in to change notification settings - Fork 689
Support @ symbol in column names with backticks and qualified syntax #2194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…olumn names) Co-authored-by: mathiasrw <[email protected]>
Co-authored-by: mathiasrw <[email protected]>
|
@copilot please run yarn jison $$ yarn test && yarn format |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: mathiasrw <[email protected]>
Completed in commit d6ddc0d:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot what if the @ is in the middle of the name? |
Co-authored-by: mathiasrw <[email protected]>
Backticks handle
The |
Description
Adds support for JSON column names containing the
@symbol using backticks or qualified column syntax. This allows querying JSON documents with@in column names (at the beginning, middle, or end) while maintaining backward compatibility with SQL Server variable syntax.Changes Made
alasqlparser.jisonto addLiteral DOT AT Literalrule in the Column production, enabling qualified column references liket.@versiontest884.jswith comprehensive tests for@symbol handling in column namesalasqlparser.jsusing jisonUsage
For JSON columns with
@symbol, use one of these approaches:@anywhere in name):SELECT `@version`, `col@middle`, `end@` FROM ?@at start with table alias):SELECT t.@version FROM ? AS tThe unqualified syntax without backticks (
SELECT @version FROM ?) is not supported to avoid conflicts with SQL Server variable syntax (@variable).Testing
@columns (beginning of name)table.@column)@columns@in middle or end of column names with backticksNotes
This implementation balances support for JSON column names with
@while preserving existing SQL Server variable functionality (DECLARE @var,SET @var,SELECT @var). Backticks (`) provide the most flexible approach, supporting@at any position in the column name.Fixes #884
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.